﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace MyMeetup.Controls
{

    public delegate void AlbumSelectedEventHandler(object sender, AlbumSelectedEventArgs e);

    public partial class AlbumPicker : UserControl
    {
        public List<Album> DataSource { get; set; }

        public AlbumPicker()
        {
            InitializeComponent();
        }
        public event AlbumSelectedEventHandler AlbumSelected;
        protected virtual void OnAlbumSelected(AlbumSelectedEventArgs e)
        {
            if (AlbumSelected != null)
                AlbumSelected(this, e);
        }

        protected void AlbumClick(object sender, RoutedEventArgs e)
        {
            Album album = sender as Album;
            OnAlbumSelected(new AlbumSelectedEventArgs { AlbumId = album.photo_album_id });
        }
    }

    public class AlbumSelectedEventArgs : EventArgs
    {
        public long AlbumId { get; set; }
    }
}
